home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / pcw.zip / QBOX.C < prev    next >
Text File  |  1990-01-16  |  2KB  |  60 lines

  1. /***********************************************************/
  2. /* File Id.                  Qbox.C                        */
  3. /* Author.                   Stan Milam                    */
  4. /* Date Written.             11/13/88.                     */
  5. /* Modifications:                                          */
  6. /*                                                         */
  7. /*           (c) Copyright 1989-90 by Stan Milam           */
  8. /*                                                         */
  9. /* Comments: This module will "box" or "frame" a portion of*/
  10. /* the text screen.                                        */
  11. /***********************************************************/
  12.  
  13. #include "pcwproto.h"
  14.  
  15. static int bdrfclr = LIGHTGRAY;
  16. static int bdrbclr = BLACK;
  17. static int btype   = 0;
  18.  
  19. static char corner [5][4] = {
  20.    {201,187,200,188},
  21.    {218,191,192,217},
  22.    {213,184,212,190},
  23.    {214,183,211,189},
  24.    {32,32,32,32}
  25. };
  26.  
  27. static char sides[5] = {186,179,179,186,32};
  28. static char tpbt[5]  = {205,196,205,196,32};
  29.  
  30. int qbox(int urow, int ucol,int lrow,int lcol) {
  31.  
  32.      int mxr, mxc;
  33.  
  34.      if (btype < 0 || btype > 4) btype = 0;
  35.      if (!chk_video_state(&mxr,&mxc)) return(0);
  36.  
  37.      qputchar(urow,ucol,bdrfclr,bdrbclr,corner[btype][0]);
  38.      qputchar(urow,lcol,bdrfclr,bdrbclr,corner[btype][1]);
  39.      qputchar(lrow,ucol,bdrfclr,bdrbclr,corner[btype][2]);
  40.      qputchar(lrow,lcol,bdrfclr,bdrbclr,corner[btype][3]);
  41.  
  42.      qhchar(urow,ucol+1,bdrfclr,bdrbclr,tpbt[btype], (lcol-ucol)-1);
  43.      qhchar(lrow,ucol+1,bdrfclr,bdrbclr,tpbt[btype], (lcol-ucol)-1);
  44.      qvchar(urow+1,ucol,bdrfclr,bdrbclr,sides[btype],(lrow-urow)-1);
  45.      qvchar(urow+1,lcol,bdrfclr,bdrbclr,sides[btype],(lrow-urow)-1);
  46.      return(1);
  47. }
  48.  
  49. void bordercolor(int fcolor, int bcolor) {
  50.  
  51.      bdrfclr = fcolor & 0x000f;
  52.      bdrbclr = bcolor & 0x000f;
  53. }
  54.  
  55. void setborder(int type) {
  56.  
  57.    if (type <0 || type > 4) return;
  58.    else btype = type;
  59. }
  60.